package com.lc.rocketmq.service;

import com.alibaba.fastjson.JSONObject;
import com.lc.rocketmq.common.Constants;
import com.lc.rocketmq.vo.SeckillVo;
import com.lc.rocketmq.vo.WaitingPayVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

/**
 * @author liuc
 * @date 2021/8/21
 * @description
 **/
@Component
public class SeckillSender {
    @Autowired
    private Sender sender;

    //发送秒杀消息
    public void seckill(SeckillVo vo){
        sender.send(Constants.TOPIC_SECKILL,vo);
    }

    //订单待支付
    public void waitingPay(WaitingPayVo vo){
        //4: 30s
        sender.sendDelay(Constants.TOPIC_WAITING_PAY,vo,4);
    }
}
